package xiaye.crawler.core.impl;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import xiaye.crawler.core.CrawlerThread;
import xiaye.crawler.core.Frontier;
import xiaye.crawler.core.PageStore;
import xiaye.crawler.domain.Page;

import com.google.inject.Inject;

public class MockCrawlerThread extends CrawlerThread{

	@Override
	public void run(){
		/*try {
			//System.out.println("start url " +address.getURL());
			sleep(new Random().nextInt(1000));
			Page page = new Page();
			page.setFinalUri(uri);
			page.setStartUri(uri);
			List<URI> outlinks = new ArrayList<URI>();
			if (uri.toString().length() < 7){
				for (int i = 0; i < 2; i++){
					try {
						outlinks.add(new URI(uri.toString()+"."+String.valueOf(i)));
					} catch (URISyntaxException e) {
						e.printStackTrace();
					}
				}
			}
			page.setOutLinks(outlinks);
			frontier.processPage(page);
			pageStore.storePage(page);
			//System.out.println("finish url "+address.getURL());
		} catch (InterruptedException e) {
			e.printStackTrace();
		}*/
	}

	@Override
	public void setUri(URI uri) {
		// TODO Auto-generated method stub
		
	}
}
